package com.qyj.spring_boot_02.mapper.mysql;

import com.qyj.spring_boot_02.bean.user.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    @Select("select * from user where name = #{name} and password=#{password} limit 1")
    User getUserOne(@Param("name") String name, @Param("password") String password);

    @Insert("insert into user (name,password,mail) values(#{name},#{password},#{mail}) ")
    boolean saveUser(@Param("name") String name, @Param("password") String password, @Param("mail") String mail);

    @Select("select * from user where name = #{name} limit 1")
    User getUserOneByName(@Param("name") String name);

    @Select("select * from user where mail = #{mail} limit 1")
    User getUserOneByMail(@Param("mail") String mail);

    User getqqUserOne(@Param("mail") String name, @Param("password") String password);

    boolean updatePwdByNameAndMail(@Param("name") String name, @Param("mail") String mail, @Param("password") String password);

    boolean updatePwdByMail(@Param("mail") String mail, @Param("password") String password);

}
